<template>
	<view class="comde">
		
		<text class="companyName">{{commpy.companyName}}</text>
		<image class="img" :src="commpy.url" mode=""></image>
		<uni-section title="公司介绍" type="line" padding>
		<text class="introductory">{{commpy.com}}</text>
		</uni-section>
	</view>
</template>

<script setup>
import { getCurrentInstance, onMounted, ref } from 'vue';
import {getcompanydate} from '../../../api/jobApi.js'
import {comlist} from '@/mock/work.js'
import {onLoad} from '@dcloudio/uni-app'
	
const id = ref()   //公司编号
const commpy =ref({}) //公司详情

const getdate=async()=>{
	// id.value= getCurrentInstance().attrs.id
	
	 let res = await getcompanydate({
			id:id.value,
			data:{}
	})

	if(res.code==200){
	commpy.value=res.data	
	}else{
		//模拟数据
	commpy.value=comlist(id.value)[0]
		
		
	}
	console.log(commpy.value);
}
	
onLoad((option)=>{
	id.value= option.id
	getdate()
})

	
// onMounted(()=>{
// 	getdate()

// })

</script>

<style lang="scss">
	.comde{

		display: flex;
		flex-direction: column;
		margin: 10px;
		
		.img{
		width: 100%;
		}
		.companyName{
			font-size:20px;
			font-weight: 700;
			margin: 16px 0px;
		}
		.introductory{
			line-height: 28px;
			color: #8b8b8b;
		}
		
	}

</style>
